package com.example.practice;

import com.example.practice.netty.NettyServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class PracticeApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(PracticeApplication.class, args);

        new Runnable() {
            @Override
            public void run() {
                try {
                    NettyServer nettyServer = applicationContext.getBean(NettyServer.class);
                    nettyServer.run();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.run();
    }

}
